import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import ClassManage from '@/components/classManage/ClassManage.vue'
import HomePage from '@/components/HomePage/HomePage.vue'
import QuestionGeneration from '@/components/questionGeneration/QuestionGeneration.vue'
import Community from '@/components/community/Community.vue'
import PostDetail from '@/components/community/PostDetail.vue'
import OneselfCenter from '@/components/community/OneselfCenter.vue'
import Course from '@/components/classManage/Course/Course.vue'
import AITeach from '@/components/AITeach/AITeach.vue'
import Ask from '@/components/AITeach/Ask.vue'
import Step from '@/components/AITeach/Step.vue'
import Information1 from '@/components/AITeach/Step2/Information1.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: HomeView,
      children: [
        {
          path: '/',  // 默认子路由
          name: 'HomePage',
          component: HomePage
        },
        {
          path: 'ClassManager',
          name: 'ClassManager',
          component: ClassManage,
        },
        {
          path: 'Course',
          name: 'Course',
          component: Course,
        },
        {
          path: 'QuestionGeneration',
          name: 'QuestionGeneration',
          component: QuestionGeneration,
        },
        {
          path: '/community',
          name: 'Community',
          component: Community
        },
        {
          path: '/post/:id',
          name: 'PostDetail',
          component: PostDetail,
          props: true
        },
        {
          path: '/profile',
          name: 'OneselfCenter',
          component: OneselfCenter
        },
        {
          path:'AITeach',
          name:'AITeach',
          component:AITeach,
          children: [
            {
              path:'',
              name:'Ask',
              component:Ask,
            },
            {
              path:'Step',
              name:'Step',
              component:Step,
              children: [
                {
                  path:'',
                  name:'Information1',
                  component:Information1,
                }
              ]
            }
          ]
        }
      ]
    }
  ]
})

export default router